#define _CRT_SECURE_NO_WARNINGS 1
int cmp(void* a, void* b) {
    return *(int*)a - *(int*)b;
}
int findGCD(int* nums, int numsSize) {
    qsort(nums, numsSize, sizeof(int), cmp);
    int max = nums[numsSize - 1];
    int min = nums[0];

    int n = max % min;
    while (n)
    {
        max = min;
        min = n;
        n = max % min;
    }
    return min;
}
